package com.cxso.example.sdk;


import com.cxso.example.sdk.http.base.ClientInfo;
import com.cxso.example.sdk.http.client.ClientManager;
import com.cxso.example.sdk.http.core.ChoiceClient;

public class SdkClient {
    /**
     * 客户端
     *
     * @param host         服务域名
     * @param clientId     客户ID
     * @param clientSecret 客户密钥
     * @return 多客户端管理类
     */
    public static ClientManager builder(String host, String clientId, String clientSecret) {
        return builder(host, clientId, clientSecret, null);
    }

    /**
     * 客户端
     *
     * @param host          服务域名
     * @param clientId      客户ID
     * @param clientSecret  客户密钥
     * @param rsaPrivateKey rsa私钥
     * @return 多客户端管理类
     */
    public static ClientManager builder(String host, String clientId, String clientSecret, String rsaPrivateKey) {
        ClientInfo clientInfo = new ClientInfo();
        clientInfo.setHost(host);
        clientInfo.setClientId(clientId);
        clientInfo.setClientSecret(clientSecret);
        clientInfo.setClientRsaPrivateKey(rsaPrivateKey);
        return new ClientManager(new ChoiceClient(clientInfo));
    }
}
